<include file="Public:head" />
<include file="Public:header" />
<include file="Public:left" />
<section id='content'>
    <div class='container-fluid'>
        <div class='row-fluid' id='content-wrapper'>
            <div class='span12'>
                <div class='row-fluid'>
                    <div class='span12'>
                        <div class='page-header'>
                            <h1 class='pull-left'>
                                <i class='icon-ok'></i>
                                <span>修改代理商资料</span>
                            </h1>
                        </div>
                    </div>
                </div>
                <div class='row-fluid'>
                    <div class='span12 box'>
                        <div class='box-header blue-background'>
                            <div class='title'>修改代理商资料</div>
                        </div>
                        <div class='box-content'>
                            <form class='form form-horizontal validate-form' style='margin-bottom: 0;' action="{:U('User/doedit_agent')}" method="post"/>
                                <div class='control-group'>
                                    <label class='control-label' for='validation_name'>登录名</label>
                                    <div class='controls'>
                                        <input data-rule-minlength='11' id='uname' name='uname' placeholder='{$agent.uname}' type='text' readonly />
                                    </div>
                                </div>
                                
                                <div class='control-group'>
                                    <label class='control-label' for='validation_password'>地区</label>
                                    <div class='controls'>
                                        <select name="pro" class="s-text-select pro">
											<option value="{$agent.area.pro.areaid}" selected><if condition="$agent['area'] eq ''">省<else />{$agent.area.pro.name}</if></option>
											<volist name="pro" id="p">
											<option  value="{$p.area_id}">{$p.title}</option>
											</volist>
										</select>
										<select name="city" class="s-text-select city">
											<option value="{$agent.area.city.areaid}" selected><if condition="$agent['area'] eq ''">市<else />{$agent.area.city.name}</if></option>
										</select>
                                    </div>
                                </div>
                                <div class='control-group'>
                                    <label class='control-label' for='validation_password_confirmation'>余额充值</label>
                                    <div class='controls'>
                                        <input data-rule-required='true' id='price' name='price' placeholder='0' type='text' value="{$agent.price}" />
                                    </div>
                                </div>
                                <div class='control-group'>
                                    <label class='control-label' for='validation_agree'>联系电话</label>
                                    <div class='controls'>
                                        <input data-rule-required='true' id='tel' name='tel' placeholder='联系电话' type='text' value="{$agent.tel}" />
                                    </div>
                                </div>
                                <div class='form-actions' style='margin-bottom:0'>
                                    <input  type='hidden' name="aid" value="{$agent.aid}"/>
                                    <button class='btn btn-primary' type='submit'>
                                        <i class='icon-save'></i>
                                        保存用户
                                    </button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                
            </div>
        </div>
    </div>
</section>
</div>
<include file="Public:bottom" />
<script type="text/javascript">
    $(document).ready(function () {
      $("ul[class='nav nav-stacked']").removeClass('in');
      $("#admin").addClass('in');
      $("li[class='guan']").removeClass('active');
      $("#agent").addClass('active');
		$(".pro").change(function(){
			pro = $(this).val();
			$.post("__URL__/getarea",{type:'city',aid:pro},function(res){
				$(".city option").remove();
				$(".city").append("<option value='0'>市</option>");
				for(i=0;i<res.length;i++){
					$(".city").append("<option value='"+res[i]['area_id']+"'>"+res[i]['title']+"</option>");
				}
			},'json');
		});
    });
</script>